package com.zzty.train.controller;



import com.zzty.train.entity.Question;
import com.zzty.train.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/question")
public class QuestionController {
    @Autowired
    private QuestionService questionService;

    @RequestMapping(value = "/addContent",method = RequestMethod.POST)
    public Question addContent(Question question){
        Question question1=questionService.addContent(question);
        return question1;
    }
    @RequestMapping(value = "/getAllQuestion")
    public List getAllQuestion(){
        List<Question> questions=questionService.getAllQuestion();
        return questions;
    }
}
